package com.itheima.myfile;

import java.io.File;
import java.io.IOException;

/**
 * @Author 王加鑫
 * @Date 2021/5/17 15:59
 * @Version 1.0
 */
public class FileTest {

    public static void main(String[] args) throws IOException {
        /*
        方式一
         */
        String path1 = "D:/MyFile/a.mp4";
        File file1 = new File(path1);
        file1.createNewFile();
        System.out.println(file1);

        /*
        方式二
         */
        File file2 = new File("D:/MyFile","c.cpp");
        System.out.println(file2);
        file2.createNewFile();

        /*
        方式三
         */
        File file3 = new File("D:/MyFile");
        String path2 = "txt.mp3";
        File file4 = new File(file3,path2);
        System.out.println(file4);
        file4.createNewFile();
    }
}
